<%-- 任务类型管理 --%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<div class="easyui-layout" fit="true" >
	<div id="easyui_toolbar" region="north" border="true" style="border-bottom:1px solid #999;height:32px;">
	
		<div style="height:5px; width:100%;"></div>
		<div style="height:10px;width:620px;float:left;"></div>
	    <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#mm',searcher:searchTaskType" style="width:300px"></input>
		<div id="mm">
			<div data-options="name:'taskType',iconCls:'icon-ok'">任务类型查找</div>
			<div data-options="name:'taskid'">任务编号查找</div>
			<div data-options="name:'taskstatus'">任务状态查找（隐藏、显示）</div>
		</div>
	</div>
	<%-- 表格数据区域 --%>
	<div region="center" border="false">
		<table id="takTypetable" ></table>
	</div>
</div>

<script type="text/javascript">

	function changestatus(obj){
		var value=$(obj).attr("value");
		var ttid=$(obj).attr("ttid");
		alert("Afsd");
	}

	//查询商品的方法
	function searchTaskType(value,name){
		$("#takTypetable").edatagrid({
			url:"backadmin/taskType.action?op=findTaskType",
		    saveUrl: "backadmin/taskType.action?op=addTaskType",
		    updateUrl: "backadmin/taskType.action?op=updateTaskType",
		    idField:"ttid",
			pagination:true,
			pageNumber:1,
			pageSize:10,
			pageList:[10,20,30,40,50],
			fit:true,
			rownumbers:true,
			sortName:"ttid",
			title:"任务类型列表",
			sortOrder:"desc",
			fitColumns:true,
			singleSelect:true,
			queryParams:{
				ttname:value,
				searchType:name
			},
			columns:[[
				{field:"ttid",title:"任务类型编号",width:100,align:"center"},
				{field:"ttname",title:"任务类型名",width:100,align:"center",editor:'text'},
				{field:"ttdescribe",title:"任务类型描述",width:100,align:"center",editor:'text'},
				{field:"ttstatus",title:"状态",width:100,align:"center",
					formatter:function(value,row,index){
						if(row.ttstatus==1){
							var a='<input type="checkbox" class="ck" checked="true" ttid='+row.ttid+' value="1" onClick="changestatus(this)"/>显示';
						}else{
							var a='<input type="checkbox" class="ck" ttid='+row.ttid+' value="0" /不显示';
						}
						return a;
					}
				},
			]],
			toolbar:[
			         {
			        	 iconCls:'icon-add',
			        	 text:"添加",
			        	 handler:function(){
			        		 $("#takTypetable").edatagrid('addRow');
			        	 }
			         },{
			        	 iconCls:'icon-save',
			        	 text:"保存",
			        	 handler:function(){
			        		 $("#takTypetable").edatagrid('saveRow');//完成添加或更新
			        	 }
			         },{
			        	 iconCls:'icon-undo',
			        	 text:"取消编辑",
			        	 handler:function(){
			        		 $("#takTypetable").edatagrid('cancelRow');
			        	 }
			  		  }
			  ]
		});
	}
	
	
	$(function(){
		searchTaskType(null,null);
	});
</script>	     